package com.dower.clothing.service.impl;

import java.util.List;

import com.dower.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dower.clothing.mapper.FinaPurchaseStatisticsMapper;
import com.dower.clothing.domain.FinaPurchaseStatistics;
import com.dower.clothing.service.IFinaPurchaseStatisticsService;
import com.dower.common.core.text.Convert;

/**
 * 进货统计Service业务层处理
 * 
 * @author dower
 * @date 2020-09-02
 */
@Service
public class FinaPurchaseStatisticsServiceImpl implements IFinaPurchaseStatisticsService 
{
    @Autowired
    private FinaPurchaseStatisticsMapper finaPurchaseStatisticsMapper;

    /**
     * 查询进货统计
     * 
     * @param purchaseStatisticsId 进货统计ID
     * @return 进货统计
     */
    @Override
    public FinaPurchaseStatistics selectFinaPurchaseStatisticsById(Long purchaseStatisticsId)
    {
        return finaPurchaseStatisticsMapper.selectFinaPurchaseStatisticsById(purchaseStatisticsId);
    }

    /**
     * 查询进货统计列表
     * 
     * @param finaPurchaseStatistics 进货统计
     * @return 进货统计
     */
    @Override
    public List<FinaPurchaseStatistics> selectFinaPurchaseStatisticsList(FinaPurchaseStatistics finaPurchaseStatistics)
    {
        return finaPurchaseStatisticsMapper.selectFinaPurchaseStatisticsList(finaPurchaseStatistics);
    }

    /**
     * 新增进货统计
     * 
     * @param finaPurchaseStatistics 进货统计
     * @return 结果
     */
    @Override
    public int insertFinaPurchaseStatistics(FinaPurchaseStatistics finaPurchaseStatistics)
    {
        finaPurchaseStatistics.setCreateTime(DateUtils.getNowDate());
        return finaPurchaseStatisticsMapper.insertFinaPurchaseStatistics(finaPurchaseStatistics);
    }

    /**
     * 修改进货统计
     * 
     * @param finaPurchaseStatistics 进货统计
     * @return 结果
     */
    @Override
    public int updateFinaPurchaseStatistics(FinaPurchaseStatistics finaPurchaseStatistics)
    {
        finaPurchaseStatistics.setUpdateTime(DateUtils.getNowDate());
        return finaPurchaseStatisticsMapper.updateFinaPurchaseStatistics(finaPurchaseStatistics);
    }

    /**
     * 删除进货统计对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteFinaPurchaseStatisticsByIds(String ids)
    {
        return finaPurchaseStatisticsMapper.deleteFinaPurchaseStatisticsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除进货统计信息
     * 
     * @param purchaseStatisticsId 进货统计ID
     * @return 结果
     */
    @Override
    public int deleteFinaPurchaseStatisticsById(Long purchaseStatisticsId)
    {
        return finaPurchaseStatisticsMapper.deleteFinaPurchaseStatisticsById(purchaseStatisticsId);
    }
}
